/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gr.anagnosg.general.utils;

import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author anagnosg
 */
public class MathUtils {
    public static double round(double d){
        double finalValue =0 ;
        try{
            DecimalFormat df=new DecimalFormat("#.##");
            String formate = "0"; 
            formate = df.format(d); 
            //new DecimalFormat("##.####").format(value)
            finalValue = Double.parseDouble( formate);
        }
        catch(Exception ex){
            //ex.printStackTrace();
        }
        return finalValue;
    }
}
